package com.zmx.doctor.view.activity;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;

import com.zmx.doctor.BaseActivity;
import com.zmx.doctor.R;
import com.zmx.doctor.okhttp.OkHttp3ClientManager;
import com.zmx.doctor.utils.AllUtil;
import com.zmx.doctor.view.util.MySharedPreferences;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ExpertTeamOrderDetailsActivity extends BaseActivity {

    private String patient_id,ask_id;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_expert_team_order_details;
    }

    @Override
    protected void initViews() {

        patient_id = this.getIntent().getStringExtra("patient_id");
        ask_id = this.getIntent().getStringExtra("ask_id");
        getData();
    }

    @SuppressLint("HandlerLeak")
    private Handler handler = new Handler(){

        @Override
        public void handleMessage(@NonNull Message msg) {
            super.handleMessage(msg);
            switch (msg.what){

                case 1:

                    break;

            }
        }
    };

    public void getData() {

        List<String> ls = new ArrayList<>();
        ls.add(ask_id);
        ls.add(patient_id);
        //请求网络
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("sign", AllUtil.md5(sing(ls)));
        params.put("token", MySharedPreferences.getInstance(mActivity).getString(MySharedPreferences.token, ""));
        params.put("uid", MySharedPreferences.getInstance(mActivity).getString(MySharedPreferences.uid, ""));
        params.put("ts", System.currentTimeMillis() / 1000); // 当前时间戳
        params.put("cmd", "teamRecord");
        params.put("data[patient_id]", patient_id);
        params.put("data[ask_id]", ask_id);
        OkHttp3ClientManager.getInstance().NetworkRequestMode("http://zmx.123xk.cn/admin/api.team/entry", params, handler, 1, 404);

    }

}
